﻿#ifndef ALARMREQ_H
#define ALARMREQ_H

#include "BaseMsg.h"

#define MSG_TYPE_ALARM_REQ "AlarmReq"

typedef enum
{
    AlarmReqType_CPU = 1,
    AlarmReqType_Memory = 2,
    AlarmReqType_HardDisk = 3,
    AlarmReqType_AppRestart = 4
}AlarmReqType;

typedef enum
{
    AlarmReqTag_alarmType = 1,

    AlarmReqTag_alarmMode = 2,

    AlarmReqTag_alarmData = 3,

} AlarmReqTag;

#define ALARM_REQ_MODE_CPU "cpu_monitor"

#define ALARM_REQ_MODE_MEM "memory_monitor"

#define ALARM_REQ_MODE_DISK "disk_monitor"

class AlarmReq : public BaseMsg
{
public:
    AlarmReq();

    AlarmReq(int alarmType, SString alarmMode, SString alarmData);

    virtual ~AlarmReq();

    virtual int decodeParametersFromTlv(TLV* tlv);

    virtual int encodeParametersIntoTlvs(list<TLV *> & tlvs);

private:
    int alarmType;
    SString alarmMode;
    SString alarmData;
};

#endif // ALARMREQ_H
